package map.ext

import com.baidu.mapapi.map.BaiduMap
import com.baidu.mapapi.map.MapView
import com.zjw.zy.utils.AppUtils
import map.map.MapManager
import map.location.LocationManager
import map.route.RouteManager
import map.search.SearchManager
import map.utils.MapManagerFactory
import map.viewmodel.MapBaseViewModel


fun MapBaseViewModel.map(): BaiduMap {
    return AppUtils.getMapActivity().map()
}

fun MapBaseViewModel.mapView(): MapView {
    return AppUtils.getMapActivity().mapView()
}

fun MapBaseViewModel.locationManager(): LocationManager =
    MapManagerFactory.get(LocationManager::class.java)

fun MapBaseViewModel.mapManager(): MapManager =
    MapManagerFactory.get(MapManager::class.java)

fun MapBaseViewModel.searchManager(): SearchManager =
    MapManagerFactory.get(SearchManager::class.java)

fun MapBaseViewModel.routeManager(): RouteManager =
    MapManagerFactory.get(RouteManager::class.java)